package com.du.service.impl;

import com.du.domain.Student;
import com.du.mapper.StudentMapper;
import com.du.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<Student> findAll() {
        return studentMapper.findAll();
    }

    @Override
    public Student findStudentByNumber(String number) {
        return studentMapper.findStudentByNumber(number);
    }

    @Override
    public void addStudent(Student student) {
        studentMapper.addStudent(student);
    }

    @Override
    public void updateStudent(Student student) {
        studentMapper.updateStudent(student);

    }

    @Override
    public void deleteStudent(String number) {
        studentMapper.deleteStudent(number);
    }
}
